﻿@model IEnumerable<Himall.Web.Areas.Admin.Models.ArticleCategoryModel>

<script src="~/Areas/Admin/Scripts/articleCategoryManagement.js"></script>

<div class="container">
    <ul class="nav nav-tabs-custom clearfix">
        <strong>文章分类</strong>
        <li class="active"><a>管理</a></li>
        <li><a class="add-article-sort" id="addArticleCategory">新增</a></li>
        <em class="primary-btn">
            <span class="glyphicon glyphicon-question-sign"></span>
            <div class="primary">
                <h3>温馨提示：</h3>
                <span>*</span><p>管理平台所有的文章及分类，文章分类最大支持二级</p>
            </div>
        </em>
    </ul>
    <table class="table category_table">
        <thead>
            <tr>
                <th>分类名称/排序</th>
                <th class="td-operate">操作</th>
            </tr>
        </thead>
        <tbody>
            @if (null == Model)
            {
                <tr>
                    <td style="text-align:center;" colspan="3"><h2>没有任何分类</h2></td>
                </tr>
            }
            else
            {
                foreach (var category in Model)
                {
                    <tr class="level-1">
                        <td>
                            <span class="glyphicon glyphicon-plus-sign @(category.HasChild ? "" : "disabled")" articlecategoryid="@category.Id"></span>
                            <input type="hidden" class="hidden_id" value="@category.Id" />
                            <input class="text-name" maxlength="5" @(category.IsDefault?"disabled":"") type="text" value="@category.Name" isdefault="@category.IsDefault.ToString()" orivalue="@category.Name" /> 
                            @*<input class="text-order" type="text" value="@category.DisplaySequence" orivalue="@category.DisplaySequence" />*@  </td>
                        <td class="td-operate">
                            <span class="btn-a">
                                <a onclick="edit(null,@category.Id)" href="javascript:;">新增下级</a>
                                @if (!@category.IsDefault)
                                {<a onclick="edit(@category.Id)" href="javascript:;">编辑</a><a class="delete-classify" href="javascript:;" onclick="del(@category.Id)">删除</a>}

                            </span>
                        </td>
                    </tr>
                }
            }
        </tbody>
    </table>
    <div class="table-bt clearfix">
        <div class="tabel-operate">
		 &nbsp;
        </div>
    </div>
</div>
